Optimal. Leaf size=221 \[ -2 f^2 p x+\frac {4 d f g p x}{3 e}-\frac {2 d^2 g^2 p x}{5 e^2}-\frac {4}{9} f g p x^3+\frac {2 d g^2 p x^3}{15 e}-\frac {2}{25} g^2 p x^5+\frac {2 \sqrt {d} f^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}-\frac {4 d^{3/2} f g p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{3 e^{3/2}}+\frac {2 d^{5/2} g^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{5 e^{5/2}}+f^2 x \log \left (c \left (d+e x^2\right )^p\right )+\frac {2}{3} f g x^3 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{5} g^2 x^5 \log \left (c \left (d+e x^2\right )^p\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 221, normalized size of antiderivative = 1.00, number of steps
used = 13, number of rules used = 6, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {2521, 2498,
327, 211, 2505, 308} \begin {gather*} -\frac {4 d^{3/2} f g p \text {ArcTan}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{3 e^{3/2}}+\frac {2 d^{5/2} g^2 p \text {ArcTan}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{5 e^{5/2}}+\frac {2 \sqrt {d} f^2 p \text {ArcTan}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}+f^2 x \log \left (c \left (d+e x^2\right )^p\right )+\frac {2}{3} f g x^3 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{5} g^2 x^5 \log \left (c \left (d+e x^2\right )^p\right )-\frac {2 d^2 g^2 p x}{5 e^2}+\frac {4 d f g p x}{3 e}+\frac {2 d g^2 p x^3}{15 e}-2 f^2 p x-\frac {4}{9} f g p x^3-\frac {2}{25} g^2 p x^5 \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 308
Rule 327
Rule 2498
Rule 2505
Rule 2521
Rubi steps
\begin {align*} \int \left (f+g x^2\right )^2 \log \left (c \left (d+e x^2\right )^p\right ) \, dx &=\int \left (f^2 \log \left (c \left (d+e x^2\right )^p\right )+2 f g x^2 \log \left (c \left (d+e x^2\right )^p\right )+g^2 x^4 \log \left (c \left (d+e x^2\right )^p\right )\right ) \, dx\\ &=f^2 \int \log \left (c \left (d+e x^2\right )^p\right ) \, dx+(2 f g) \int x^2 \log \left (c \left (d+e x^2\right )^p\right ) \, dx+g^2 \int x^4 \log \left (c \left (d+e x^2\right )^p\right ) \, dx\\ &=f^2 x \log \left (c \left (d+e x^2\right )^p\right )+\frac {2}{3} f g x^3 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{5} g^2 x^5 \log \left (c \left (d+e x^2\right )^p\right )-\left (2 e f^2 p\right ) \int \frac {x^2}{d+e x^2} \, dx-\frac {1}{3} (4 e f g p) \int \frac {x^4}{d+e x^2} \, dx-\frac {1}{5} \left (2 e g^2 p\right ) \int \frac {x^6}{d+e x^2} \, dx\\ &=-2 f^2 p x+f^2 x \log \left (c \left (d+e x^2\right )^p\right )+\frac {2}{3} f g x^3 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{5} g^2 x^5 \log \left (c \left (d+e x^2\right )^p\right )+\left (2 d f^2 p\right ) \int \frac {1}{d+e x^2} \, dx-\frac {1}{3} (4 e f g p) \int \left (-\frac {d}{e^2}+\frac {x^2}{e}+\frac {d^2}{e^2 \left (d+e x^2\right )}\right ) \, dx-\frac {1}{5} \left (2 e g^2 p\right ) \int \left (\frac {d^2}{e^3}-\frac {d x^2}{e^2}+\frac {x^4}{e}-\frac {d^3}{e^3 \left (d+e x^2\right )}\right ) \, dx\\ &=-2 f^2 p x+\frac {4 d f g p x}{3 e}-\frac {2 d^2 g^2 p x}{5 e^2}-\frac {4}{9} f g p x^3+\frac {2 d g^2 p x^3}{15 e}-\frac {2}{25} g^2 p x^5+\frac {2 \sqrt {d} f^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}+f^2 x \log \left (c \left (d+e x^2\right )^p\right )+\frac {2}{3} f g x^3 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{5} g^2 x^5 \log \left (c \left (d+e x^2\right )^p\right )-\frac {\left (4 d^2 f g p\right ) \int \frac {1}{d+e x^2} \, dx}{3 e}+\frac {\left (2 d^3 g^2 p\right ) \int \frac {1}{d+e x^2} \, dx}{5 e^2}\\ &=-2 f^2 p x+\frac {4 d f g p x}{3 e}-\frac {2 d^2 g^2 p x}{5 e^2}-\frac {4}{9} f g p x^3+\frac {2 d g^2 p x^3}{15 e}-\frac {2}{25} g^2 p x^5+\frac {2 \sqrt {d} f^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{\sqrt {e}}-\frac {4 d^{3/2} f g p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{3 e^{3/2}}+\frac {2 d^{5/2} g^2 p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )}{5 e^{5/2}}+f^2 x \log \left (c \left (d+e x^2\right )^p\right )+\frac {2}{3} f g x^3 \log \left (c \left (d+e x^2\right )^p\right )+\frac {1}{5} g^2 x^5 \log \left (c \left (d+e x^2\right )^p\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 151, normalized size = 0.68 \begin {gather*} \frac {30 \sqrt {d} \left (15 e^2 f^2-10 d e f g+3 d^2 g^2\right ) p \tan ^{-1}\left (\frac {\sqrt {e} x}{\sqrt {d}}\right )+\sqrt {e} x \left (-2 p \left (45 d^2 g^2-15 d e g \left (10 f+g x^2\right )+e^2 \left (225 f^2+50 f g x^2+9 g^2 x^4\right )\right )+15 e^2 \left (15 f^2+10 f g x^2+3 g^2 x^4\right ) \log \left (c \left (d+e x^2\right )^p\right )\right )}{225 e^{5/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 9 vs. order
3.
time = 0.71, size = 686, normalized size = 3.10
method | result | size |
risch | \(-\frac {i \pi \,g^{2} x^{5} \mathrm {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \right )}{10}+\frac {i \pi f g \,x^{3} \mathrm {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{2}}{3}+\frac {i \pi f g \,x^{3} \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{2} \mathrm {csgn}\left (i c \right )}{3}-\frac {i \pi \,f^{2} \mathrm {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \right ) x}{2}+\left (\frac {1}{5} g^{2} x^{5}+\frac {2}{3} f g \,x^{3}+f^{2} x \right ) \ln \left (\left (e \,x^{2}+d \right )^{p}\right )+\ln \left (c \right ) f^{2} x +\frac {\ln \left (c \right ) g^{2} x^{5}}{5}-\frac {2 \sqrt {-e d}\, p \ln \left (-\sqrt {-e d}\, x +d \right ) d f g}{3 e^{2}}+\frac {2 \sqrt {-e d}\, p \ln \left (\sqrt {-e d}\, x +d \right ) d f g}{3 e^{2}}+\frac {i \pi \,g^{2} x^{5} \mathrm {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{2}}{10}+\frac {i \pi \,g^{2} x^{5} \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{2} \mathrm {csgn}\left (i c \right )}{10}+\frac {\sqrt {-e d}\, p \ln \left (-\sqrt {-e d}\, x +d \right ) f^{2}}{e}-\frac {\sqrt {-e d}\, p \ln \left (\sqrt {-e d}\, x +d \right ) f^{2}}{e}-\frac {4 f g p \,x^{3}}{9}-2 f^{2} p x -\frac {2 g^{2} p \,x^{5}}{25}-\frac {2 d^{2} g^{2} p x}{5 e^{2}}+\frac {2 d \,g^{2} p \,x^{3}}{15 e}+\frac {\sqrt {-e d}\, p \ln \left (-\sqrt {-e d}\, x +d \right ) d^{2} g^{2}}{5 e^{3}}-\frac {\sqrt {-e d}\, p \ln \left (\sqrt {-e d}\, x +d \right ) d^{2} g^{2}}{5 e^{3}}-\frac {i \pi f g \,x^{3} \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{3}}{3}+\frac {i \pi \,f^{2} \mathrm {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{2} x}{2}+\frac {i \pi \,f^{2} \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{2} \mathrm {csgn}\left (i c \right ) x}{2}-\frac {i \pi f g \,x^{3} \mathrm {csgn}\left (i \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right ) \mathrm {csgn}\left (i c \right )}{3}+\frac {4 d f g p x}{3 e}+\frac {2 \ln \left (c \right ) f g \,x^{3}}{3}-\frac {i \pi \,f^{2} \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{3} x}{2}-\frac {i \pi \,g^{2} x^{5} \mathrm {csgn}\left (i c \left (e \,x^{2}+d \right )^{p}\right )^{3}}{10}\) | \(686\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.57, size = 146, normalized size = 0.66 \begin {gather*} \frac {2}{225} \, {\left (\frac {15 \, {\left (3 \, d^{3} g^{2} - 10 \, d^{2} f g e + 15 \, d f^{2} e^{2}\right )} \arctan \left (\frac {x e^{\frac {1}{2}}}{\sqrt {d}}\right ) e^{\left (-\frac {7}{2}\right )}}{\sqrt {d}} - {\left (9 \, g^{2} x^{5} e^{2} - 5 \, {\left (3 \, d g^{2} e - 10 \, f g e^{2}\right )} x^{3} + 15 \, {\left (3 \, d^{2} g^{2} - 10 \, d f g e + 15 \, f^{2} e^{2}\right )} x\right )} e^{\left (-3\right )}\right )} p e + \frac {1}{15} \, {\left (3 \, g^{2} x^{5} + 10 \, f g x^{3} + 15 \, f^{2} x\right )} \log \left ({\left (x^{2} e + d\right )}^{p} c\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 373, normalized size = 1.69 \begin {gather*} \left [-\frac {1}{225} \, {\left (90 \, d^{2} g^{2} p x - 15 \, {\left (3 \, g^{2} p x^{5} + 10 \, f g p x^{3} + 15 \, f^{2} p x\right )} e^{2} \log \left (x^{2} e + d\right ) - 15 \, {\left (3 \, g^{2} x^{5} + 10 \, f g x^{3} + 15 \, f^{2} x\right )} e^{2} \log \left (c\right ) - 15 \, {\left (3 \, d^{2} g^{2} p - 10 \, d f g p e + 15 \, f^{2} p e^{2}\right )} \sqrt {-d e^{\left (-1\right )}} \log \left (\frac {x^{2} e + 2 \, \sqrt {-d e^{\left (-1\right )}} x e - d}{x^{2} e + d}\right ) + 2 \, {\left (9 \, g^{2} p x^{5} + 50 \, f g p x^{3} + 225 \, f^{2} p x\right )} e^{2} - 30 \, {\left (d g^{2} p x^{3} + 10 \, d f g p x\right )} e\right )} e^{\left (-2\right )}, -\frac {1}{225} \, {\left (90 \, d^{2} g^{2} p x - 30 \, {\left (3 \, d^{2} g^{2} p - 10 \, d f g p e + 15 \, f^{2} p e^{2}\right )} \sqrt {d} \arctan \left (\frac {x e^{\frac {1}{2}}}{\sqrt {d}}\right ) e^{\left (-\frac {1}{2}\right )} - 15 \, {\left (3 \, g^{2} p x^{5} + 10 \, f g p x^{3} + 15 \, f^{2} p x\right )} e^{2} \log \left (x^{2} e + d\right ) - 15 \, {\left (3 \, g^{2} x^{5} + 10 \, f g x^{3} + 15 \, f^{2} x\right )} e^{2} \log \left (c\right ) + 2 \, {\left (9 \, g^{2} p x^{5} + 50 \, f g p x^{3} + 225 \, f^{2} p x\right )} e^{2} - 30 \, {\left (d g^{2} p x^{3} + 10 \, d f g p x\right )} e\right )} e^{\left (-2\right )}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 478 vs.
\(2 (231) = 462\).
time = 35.03, size = 478, normalized size = 2.16 \begin {gather*} \begin {cases} \left (f^{2} x + \frac {2 f g x^{3}}{3} + \frac {g^{2} x^{5}}{5}\right ) \log {\left (0^{p} c \right )} & \text {for}\: d = 0 \wedge e = 0 \\- 2 f^{2} p x + f^{2} x \log {\left (c \left (e x^{2}\right )^{p} \right )} - \frac {4 f g p x^{3}}{9} + \frac {2 f g x^{3} \log {\left (c \left (e x^{2}\right )^{p} \right )}}{3} - \frac {2 g^{2} p x^{5}}{25} + \frac {g^{2} x^{5} \log {\left (c \left (e x^{2}\right )^{p} \right )}}{5} & \text {for}\: d = 0 \\\left (f^{2} x + \frac {2 f g x^{3}}{3} + \frac {g^{2} x^{5}}{5}\right ) \log {\left (c d^{p} \right )} & \text {for}\: e = 0 \\\frac {2 d^{3} g^{2} p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{5 e^{3} \sqrt {- \frac {d}{e}}} - \frac {d^{3} g^{2} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{5 e^{3} \sqrt {- \frac {d}{e}}} - \frac {4 d^{2} f g p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{3 e^{2} \sqrt {- \frac {d}{e}}} + \frac {2 d^{2} f g \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{3 e^{2} \sqrt {- \frac {d}{e}}} - \frac {2 d^{2} g^{2} p x}{5 e^{2}} + \frac {2 d f^{2} p \log {\left (x - \sqrt {- \frac {d}{e}} \right )}}{e \sqrt {- \frac {d}{e}}} - \frac {d f^{2} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{e \sqrt {- \frac {d}{e}}} + \frac {4 d f g p x}{3 e} + \frac {2 d g^{2} p x^{3}}{15 e} - 2 f^{2} p x + f^{2} x \log {\left (c \left (d + e x^{2}\right )^{p} \right )} - \frac {4 f g p x^{3}}{9} + \frac {2 f g x^{3} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{3} - \frac {2 g^{2} p x^{5}}{25} + \frac {g^{2} x^{5} \log {\left (c \left (d + e x^{2}\right )^{p} \right )}}{5} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 3.93, size = 201, normalized size = 0.91 \begin {gather*} \frac {2 \, {\left (3 \, d^{3} g^{2} p - 10 \, d^{2} f g p e + 15 \, d f^{2} p e^{2}\right )} \arctan \left (\frac {x e^{\frac {1}{2}}}{\sqrt {d}}\right ) e^{\left (-\frac {5}{2}\right )}}{15 \, \sqrt {d}} + \frac {1}{225} \, {\left (45 \, g^{2} p x^{5} e^{2} \log \left (x^{2} e + d\right ) - 18 \, g^{2} p x^{5} e^{2} + 45 \, g^{2} x^{5} e^{2} \log \left (c\right ) + 30 \, d g^{2} p x^{3} e + 150 \, f g p x^{3} e^{2} \log \left (x^{2} e + d\right ) - 100 \, f g p x^{3} e^{2} + 150 \, f g x^{3} e^{2} \log \left (c\right ) - 90 \, d^{2} g^{2} p x + 300 \, d f g p x e + 225 \, f^{2} p x e^{2} \log \left (x^{2} e + d\right ) - 450 \, f^{2} p x e^{2} + 225 \, f^{2} x e^{2} \log \left (c\right )\right )} e^{\left (-2\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.34, size = 193, normalized size = 0.87 \begin {gather*} \ln \left (c\,{\left (e\,x^2+d\right )}^p\right )\,\left (f^2\,x+\frac {2\,f\,g\,x^3}{3}+\frac {g^2\,x^5}{5}\right )-x\,\left (2\,f^2\,p-\frac {d\,\left (\frac {4\,f\,g\,p}{3}-\frac {2\,d\,g^2\,p}{5\,e}\right )}{e}\right )-x^3\,\left (\frac {4\,f\,g\,p}{9}-\frac {2\,d\,g^2\,p}{15\,e}\right )-\frac {2\,g^2\,p\,x^5}{25}+\frac {2\,\sqrt {d}\,p\,\mathrm {atan}\left (\frac {\sqrt {d}\,\sqrt {e}\,p\,x\,\left (3\,d^2\,g^2-10\,d\,e\,f\,g+15\,e^2\,f^2\right )}{3\,p\,d^3\,g^2-10\,p\,d^2\,e\,f\,g+15\,p\,d\,e^2\,f^2}\right )\,\left (3\,d^2\,g^2-10\,d\,e\,f\,g+15\,e^2\,f^2\right )}{15\,e^{5/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________